<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <p>我叫 {{ obj.name }}， 今年 {{ obj.age }} 岁了</p>
  </div>
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <script>
    // 从 Vue 中解构出 createApp, reactive
    const { createApp, reactive } = Vue

    createApp({
      setup () {
        // 创建一个响应式对象

        // 注意：reactive的参数只能是对象
        const obj = reactive({
          name: '小vue',
          age: 9
        })

        // 返回响应式数据
        return {
          obj,
          num
        }
      }
    }).mount('#app')
  </script>
</body>

</html>